/**
 *
 * Copyright Pact Lab of H.I.T.
 *
 * Designed and Implemented by Grid Researching Group, 
 * Pact Lab, Harbin
 * 
 * This Project is part of the national 973 Project:
 * Internet Based Virtual Computing Environment
 *
 * http://pact518.hit.edu.cn
 * 
 * Author:       Meteor <meteorlxk@gmail.com> 
 * Copyright:    pact518 
 * Version:      1.0
 * Created:      2009-4-7 
 * LastModified: 2009-4-7
 */
package edu.hit.pact.pgse.communication.message;

import java.io.Serializable;

/**
 * A base message for PGSE_4 communication messages.
 * 
 * @author Meteor
 * 
 */
public abstract class AbstractMessage implements Serializable {

	private static final long serialVersionUID = 2780027401059934269L;
	
	private COMMUNICATION_TYPE type;
	
	private boolean needReply;

	public static enum COMMUNICATION_TYPE {
		TASK_PUSH, TASK_PUSH_REPLY, TASK_QUERY, TASK_QUERY_REPLY, 
		TASK_CANCEL, TASK_CANCEL_REPLY, HEART_BEAT, HEART_BEAT_RERLY, 
		TASK_STATISTICS, TASK_STATISTICS_REPLY,
		PAGE_SEND_QUERY, PAGE_SEND_REPLY, PAGE_SEND_RAWPAGE,
		CRAWLER_REGISTER,
		SPEED_REPORT
	}
	
	/**
	 * @return the type
	 */
	public COMMUNICATION_TYPE getType() {
		return type;
	}

	/**
	 * @return the needReply
	 */
	public boolean isNeedReply() {
		return needReply;
	}

	/**
	 * @param type
	 * @param needReply
	 */
	public AbstractMessage(COMMUNICATION_TYPE type, boolean needReply) {
		super();
		this.type = type;
		this.needReply = needReply;
	}


	
}
